package day04;
import java.util.Scanner;//1.导入一个扫描仪
// Scanner 的演示
public class ScannerDemo {
    public static void main(String[] args) {
        /*
        * package java.util;
        * class Scanner{
        *   Scanner(InputStream s){...}
        *   int nextInt(){...}
        *   double nextDouble(){...}
        * }
        *
        * import java.util.Scanner;
        * Scanner scan = new Scanner(System.in)
        * int age = scan.nextInt();
        * double price = scan.nextDouble();
        * */
      Scanner scan = new Scanner(System.in);//2.新建一个扫描仪叫scan
      System.out.println("请输入年龄");
      int age = scan.nextInt();//3.扫描一个整数并赋值给age
      System.out.println("请输入商品价格:");
      double price = scan.nextDouble();//扫描一个数并赋值给price
      System.out.println("年龄为:"+age+",价格为:"+price);

    }
}
